using System;
using System.Collections.Generic;
using System.Text;

namespace Typing_GUI.CLASS
{
    public class CCapDoNguoiDung
    {
        int maCapDo;

        public int MaCapDo
        {
            get { return maCapDo; }
            set { maCapDo = value; }
        }
        string tenCapDo;

        public string TenCapDo
        {
            get { return tenCapDo; }
            set { tenCapDo = value; }
        }
        string hinhAnh;

        public string HinhAnh
        {
            get { return hinhAnh; }
            set { hinhAnh = value; }
        }
        string moTa;

        public string MoTa
        {
            get { return moTa; }
            set { moTa = value; }
        }
        int diemChuan;

        public int DiemChuan
        {
            get { return diemChuan; }
            set { diemChuan = value; }
        }

        public static List<CCapDoNguoiDung> GetUserLevels()
        {
            List<CCapDoNguoiDung> userLevelList = new List<CCapDoNguoiDung>();
            string sql = "select*from CapDoNguoiDung";
            System.Data.DataTable dt = DataProvider.ExecuteQuery(sql);
            foreach (System.Data.DataRow dr in dt.Rows)
            {
                CCapDoNguoiDung level = new CCapDoNguoiDung();
                level.maCapDo = int.Parse(dr["MaCapDoNguoiDung"].ToString());
                level.tenCapDo = dr["TenCapDo"].ToString();
                level.hinhAnh = dr["HinhAnh"].ToString();
                level.MoTa = dr["MoTa"].ToString();
                level.diemChuan = int.Parse(dr["DiemChuan"].ToString());
                userLevelList.Add(level);
            }
            return userLevelList;
        }
    }
}
